Asynchronous method and system for performing an operation on metadata

ABSTRACT

In accordance with embodiments, there are provided mechanisms and methods for asynchronously performing an operation on metadata in the context of an on-demand database service. These mechanisms and methods for asynchronously performing an operation on metadata can enable embodiments to allow a subscriber to perform other database service operations, while the aforementioned operation is being performed on the metadata. The ability of embodiments to provide such feature can enable the performance of a larger number of operations on metadata without necessarily interrupting the ability of the subscriber to perform other operations using the on-demand database service.

CLAIM OF PRIORITY

This application claims the benefit of U.S. Provisional PatentApplication 60/827,875 entitled “Method And System For Updating ASubscriber Environment Of An On-Demand Database Service,” by Jasik etal., filed Oct. 2, 2006 (Attorney Docket No. SFC1P003+/033PROV), theentire contents of which are incorporated herein by reference.

COPYRIGHT NOTICE

A portion of the disclosure of this patent document contains materialwhich is subject to copyright protection. The copyright owner has noobjection to the facsimile reproduction by anyone of the patent documentor the patent disclosure, as it appears in the Patent and TrademarkOffice patent file or records, but otherwise reserves all copyrightrights whatsoever.

FIELD OF THE INVENTION

The current invention relates generally to performing operations onmetadata in a database network system.

BACKGROUND

The subject matter discussed in the background section should not beassumed to be prior art merely as a result of its mention in thebackground section. Similarly, a problem mentioned in the backgroundsection or associated with the subject matter of the background sectionshould not be assumed to have been previously recognized in the priorart. The subject matter in the background section merely representsdifferent approaches, which in and of themselves may also be inventions.

In conventional database systems, users access their data resources inone logical database. A user of such a conventional system typicallyretrieves data from and stores data on the system using the user's ownsystems. A user system might remotely access one of a plurality ofserver systems that might in turn access the database system. Dataretrieval from the system might include the issuance of a query from theuser system to the database system. The database system might processthe request for information received in the query and send to the usersystem information relevant to the request.

During use, a user often desires to modify metadata to tailor use ofsuch database systems for a particular application. Non-limitingexamples of such metadata may include, but are not limited to an object,field, etc. Typically, such metadata is modified using a web-basedinterface or the like which allows a user to manually create, change,etc. the metadata.

While such technique works well for modifying a small number ofdifferent metadata instances, it can be problematic when attempting tomodify a larger number of metadata instances. For example, a largenumber of metadata modifications may fully utilize database systemprocessing/bandwidth resources, such that the database system may beunable to perform other operations requested by the user. There is thusa need for addressing these and/or other issues.

BRIEF SUMMARY

In accordance with embodiments, there are provided mechanisms andmethods for asynchronously performing an operation on metadata in thecontext of an on-demand database service. These mechanisms and methodsfor asynchronously performing an operation on metadata can enableembodiments to allow a subscriber to perform other database serviceoperations, while the aforementioned operation is being performed on themetadata. The ability of embodiments to provide such feature can enablethe performance of a larger number of operations on metadata withoutnecessarily interrupting the ability of the subscriber to perform otheroperations using the on-demand database service.

In an embodiment and by way of example, a method for asynchronouslyperforming an operation on metadata is provided. The method embodimentincludes receiving at least one instruction indicating at least oneoperation to be performed on metadata associated with an environment ofa subscriber of an on-demand database service. In use, the at least oneoperation is performed on the metadata associated with the environmentof the subscriber asynchronously with respect to at least one otheroperation performed by the subscriber using the on-demand databaseservice.

While the present invention is described with reference to an embodimentin which techniques for asynchronously performing an operation onmetadata are implemented in a system having an application serverproviding a front end for an on-demand database service capable ofsupporting multiple tenants, the present invention is not limited tomulti-tenant databases nor deployment on application servers.Embodiments may be practiced using other database architectures, i.e.,ORACLE®, DB2® by IBM and the like without departing from the scope ofthe embodiments claimed.

Any of the above embodiments may be used alone or together with oneanother in any combination. Inventions encompassed within thisspecification may also include embodiments that are only partiallymentioned or alluded to or are not mentioned or alluded to at all inthis brief summary or in the abstract. Although various embodiments ofthe invention may have been motivated by various deficiencies with theprior art, which may be discussed or alluded to in one or more places inthe specification, the embodiments of the invention do not necessarilyaddress any of these deficiencies. In other words, different embodimentsof the invention may address different deficiencies that may bediscussed in the specification. Some embodiments may only partiallyaddress some deficiencies or just one deficiency that may be discussedin the specification, and some embodiments may not address any of thesedeficiencies.

BRIEF DESCRIPTION OF THE DRAWINGS

In the following drawings like reference numbers are used to refer tolike elements. Although the following figures depict various examples ofthe invention, the invention is not limited to the examples depicted inthe figures.

FIG. 1 illustrates a method for asynchronously performing an operationon metadata in the context of an on-demand database service, inaccordance with one embodiment.

FIGS. 2A and 2B show a method for handling the receipt of a request tomodify metadata, in accordance with another embodiment.

FIG. 3 shows a method for processing requests for modifying metadata, inaccordance with another embodiment.

FIG. 4 shows a method for performing a group of operations on metadatain the context of an on-demand database service, in accordance with oneembodiment.

FIGS. 5A-5B show a method for performing a group of operations onmetadata in the context of an on-demand database service, in accordancewith another embodiment.

FIG. 6 illustrates a block diagram of an example of an environmentwherein an on-demand database service might be used.

FIG. 7 illustrates a block diagram of an embodiment of elements of FIG.6 and various possible interconnections between these elements.

DETAILED DESCRIPTION General Overview

Systems and methods are provided for asynchronously performing anoperation on metadata. In the context of the present description, theterm “asynchronous performance” when used to describe an operationconducted on metadata associated with an on-demand database servicerefers to performing any operation, at least in part, independently ofany other operation performed in the on-demand database service. Suchindependent performance may be any one or more of temporallyindependent, independent by control, independent in location or thelike.

During use, a subscriber often desires to modify metadata (e.g. anobject, field, etc.) to tailor use of an on-demand database service fora particular application. While such metadata may be modified using aweb-based interface or the like by creating, adding to, deleting,changing, etc. the same, there is also a desire to be able to modifysuch metadata in a more automated manner (e.g. using a schema tool,etc.). In any case, it is desirable that the on-demand database servicebe available for other operations while such modifications are beingimplemented. For example, in the presence of any attempt to modifymetadata and, more particularly a large number of metadata instances,the on-demand database service may be more apt to “hang” due to a lackof necessary resources and may further exhibit an inability to performany additional services requested by the subscriber.

The following exemplary embodiments illustrate methods and mechanismthat enable asynchronously performance of an operation on metadata toaddress the foregoing need.

FIG. 1 illustrates a method 100 for asynchronously performing anoperation on metadata in the context of an on-demand database service,in accordance with one embodiment. In the context of the presentdescription, such on-demand database service may include any servicethat relies on a database that is accessible over a network. Variousexamples of such an on-demand database service will be set forth in thecontext of different embodiments that will be described during referenceto subsequent figures.

In one embodiment, the aforementioned on-demand database service mayinclude a multi-tenant database system. As used herein, the termmulti-tenant database system refers to those systems in which variouselements of hardware and software of the database system may be sharedby one or more customers. For example, a given application server maysimultaneously process requests for a great number of customers, and agiven database table may store rows for a potentially much greaternumber of customers.

As shown in operation 102, at least one instruction is receivedindicating at least one operation to be performed on metadata associatedwith an environment of a subscriber (i.e. any person or entity, etc.) ofan on-demand database service. In the context of the presentdescription, the foregoing instruction may include any data, code, etc.that is capable of being received and/or processed for the purpose ofprompting the operation to be performed on the metadata. In variousembodiments, the operation may include a modification (e.g. creating,adding, deleting, changing, etc.), processing, and/or any otheroperation that involves the metadata, at least in part. Still yet, themetadata may include a configuration, object, field, default value,name, data type, required indicator, default value schema, and/or anyother data that is capable of being used to describe other data. Somenon-limiting examples of operations that may be performed on metadatainclude adding new contacts, changing account information, etc.

In one embodiment, the instruction may be received from a user using aweb-based interface. For example, such interface may allow a user tomanually initiate the operation on the metadata by selecting eachoperation (e.g. modification, etc.) and metadata to be subjected to theoperation, using an input device. In other embodiments, the instructionmay be received in a more automated manner. For example, the instructionmay be received from an application in response to a rule beingtriggered, as a result of a process configured by a user, etc. Anon-limiting example of a tool that may be used for such purposeincludes a schema tool, a third-party programmable application, etc. Inanother embodiment, the instruction may be received utilizing anapplication program interface (API) that is capable of receivinginstructions from a variety of sources.

Next, in operation 104, the operation is performed on the metadataassociated with the environment of the subscriber asynchronously withrespect to at least one other operation performed by the subscriberusing the on-demand database service. In the context of the presentdescription, the aforementioned environment of the subscriber mayinclude any aspect of the on-demand database service that is associatedwith the subscriber. For example, such environment may be differentdepending on a particular type of on-demand database service applicationto which the subscriber subscribes. Various examples of applications ofan on-demand database service will be set forth in the context ofdifferent embodiments that will be described during reference tosubsequent figures.

In the context of the present description, the term “asynchronousperformance” when used to describe an operation conducted on metadataassociated with an on-demand database service refers to performing anyoperation, at least in part, independently of any other operationperformed in the on-demand database service. Such independentperformance may be any one or more of temporally independent,independent by control, independent in location or the like. Of course,in various embodiments, such other operation may include any operationthat is either similar to or different from that associated with theinstruction(s) received in operation 102. By this design, the subscribermay independently perform the other operation without being necessarilyaffected by the performance of the operations associated with theinstruction(s) received in operation 102.

More illustrative information will now be set forth regarding variousoptional architectures and features with which the foregoing frameworkmay or may not be implemented, per the desires of the user. It should bestrongly noted that the following information is set forth forillustrative purposes and should not be construed as limiting in anymanner. Any of the following features may be optionally incorporatedwith or without the exclusion of other features described.

FIGS. 2A and 2B show a method 200 for handling the receipt of a requestto modify metadata, in accordance with another embodiment. As an option,the present method 200 may be implemented in the context of thefunctionality of FIG. 1. Of course, however, the method 200 may becarried out in any desired environment. The aforementioned definitionsmay apply during the present description.

As shown, it is first determined whether a request has been received tomodify (e.g. create, add, delete, change, etc.) metadata. See decision202. In various embodiments, such request may be manually orautomatically generated. Further, in one embodiment, such request may bedirected to an on-demand database service, and include one or moreinstructions for performing one or more operations on the metadata.

Upon receipt of such a request, it is determined whether the request ispermissible. Note decision 204. For example, it may be determinedwhether the instruction(s)/operation(s) is permissible. In oneembodiment, such decision may be based on a status and associated accessrights of the subscriber that made the request, rules surrounding themodification of the metadata (e.g. size limits, etc.), rules surroundingthe request itself (e.g. formatting, protocol issues, etc.), etc. If itis determined that the request is impermissible, an error message issent to the subscriber (see operation 206) and the underlyinginstruction(s)/operation(s) are disallowed. To this end, the operationassociated with the request is conditionally performed on the metadata,based on the determination of operation 204.

On the other hand, if it is determined that the request is permissibleper decision 204, the method 200 continues by initiating the processingof the request. See operation 208. Such processing results in theperformance of any necessary operation on the metadata. One example ofan execution of operation 208 will be set forth in the context of adifferent embodiment that will be described during reference to FIG. 3.

In further response to the receipt of the request and associatedinstruction(s), etc., a confirmation message is provided to thesubscriber that the related processing has been initiated. Noteoperation 210. With the processing pending, a user may, at any timerequest a status of the processing. Such request, for example, may besent to the on-demand database service via a web-based interface byselecting a status icon or the like.

Once it is determined that the on-demand database service has receivedsuch status request (see decision 2112), the status is provided in theform of a status message. See operation 214. In various embodiments, thestatus may range from a simple completed/not complete indication, to amore detailed status that includes information on how/when a request wascompleted or why a request has not yet been completed. Non-limitingexamples of such status may include “request received,” “requestpending,” “request completed,” etc.

In one optional embodiment, requests may be tracked for a limited amountof time, and thereafter discarded. This may be helpful in limiting anamount of resources (e.g. storage, etc.) required to administer theforegoing status checking functionality. In such embodiment, it may bedetermined, after the request processing has been initiated, whether apredetermined amount of time (e.g. 24 hours, etc.) has elapsed. Notedecision 216. If so, any status tracking data structure may bediscarded, as indicated in operation 218. To this end, the statusmessage is conditionally sent to the subscriber, based on a time periodwithin which the status request is received.

FIG. 3 shows a method 300 for processing requests for modifyingmetadata, in accordance with another embodiment. As an option, thepresent method 300 may be implemented in the context of thefunctionality of FIGS. 1-2. For example, the method 300 may be used toprocess a large number of requests at least a portion of which werereceived via the method 200 of FIGS. 2A-2B. Of course, however, themethod 300 may be carried out in any desired environment. Yet again, theaforementioned definitions may apply during the present description.

In one embodiment, any requests received (e.g. via the method 200 ofFIG. 2A/2B, etc.) may be queued (not shown). Further, each request maybe pulled from such queue for processing in accordance with the method300 of FIG. 3. As shown, each request may be inspected, as set forth inoperation 302. Such inspection may involve a header of the request orany other portion that indicates whether the request is an asynchronousrequest (which may be accompanied by an instruction, etc.).

In the present embodiment, the asynchronous request may be one thatprompts an operation on metadata which does not necessarily have to becompleted in real-time. For example, such an asynchronous request may beone that is received via a schema tool or the like (as opposed to ahuman subscriber, etc.). Thus, unlike a human subscriber request, such arequest may be delayed via asynchronous processing without necessarilynegatively impacting a subscriber experience.

If it is determined that the request is not an asynchronous request perdecision 304, the request may be handled by a synchronous process. Seeoperation 306. In one embodiment, such synchronous process may beallocated with sufficient resources to allow for real-time, near-realtime, etc. processing of the request.

On the other hand, if it is determined that the request is anasynchronous request per decision 304, the request may be handled by anasynchronous process. Such asynchronous process may include a threadpool that is allocated a finite amount of a local resources (e.g. one ormore application server, etc.). In such embodiment, such thread pool maybe inspected before assigning a request to the same. See operation 308.

In conjunction with such inspection, it is determined whether the localthread pool has any spare capacity or at least enough capacity toprocess the request in real-time. See decision 310. If so, arequest-tracking data structure is updated (e.g. a row is created) toreflect that the present request is being handled by the local threadpool. Note operation 312.

In use, such data structure may be used for status checking (e.g. seeoperations 212-214 of FIG. 2A/2B, etc.), managing request processing,etc. In various embodiments, the tracking data structure may include avariety of fields such as a request identifier (assigned by theservice), requested operation/metadata identifier, status information,an indication as to whether the corresponding request has been allocatedto a resource (e.g. a thread, etc.), etc.

However, if it is determined that the local thread pool does not haveany spare capacity or not enough capacity to process the request perdecision 310, the request processing-tracking data structure is updatedto reflect that the present request is not being handled by the localthread pool. Note operation 314. To this end, such requests may bequeued and other resources (e.g. back-up resources such as a batchserver, etc.) may be notified of the fact that the present requestrequires processing. In any case, whether the request is processed bythe local thread pool or using other resources, the metadata may bemodified and values associated with the metadata may be updated inresponse to such metadata modification.

As the request processing is completed, the aforementioned datastructure may be updated to reflect such status. Further, any databaserows that reflect the completed status may be deleted after apredetermined amount of time (e.g. 24 hours). See, for example,operations 216-218 of FIG. 2A/2B.

FIG. 4 shows a method 400 for applying a group of instructions tometadata in the context of an on-demand database service, in accordancewith one embodiment. As an option, the present method 400 may beimplemented in the context of the functionality of FIGS. 1-3. Forexample, the method 400 may or may not incorporate the various featuresof the previous embodiments where, instead of just one instruction beingreceived at a time, a group of instructions may be received. Of course,however, the method 400 may be carried out in any desired environment.The aforementioned definitions may apply during the present description.

As shown, a group of instructions may be received indicating at leastone operation to be performed on a plurality of instances of metadataassociated with an environment of a subscriber of an on-demand databaseservice. See operation 402. With respect to each of the terms set forthin operation 402, corresponding definitions may be found, whereapplicable, during the description of FIG. 1 above.

Further, it should be noted that the group may be defined in any desiredmanner. For example, in one embodiment, a subscriber may manually enterthe instructions (e.g. by requiring one or more modifications tometadata, etc.). Thus, the group may, in such embodiment, besubscriber-defined.

In other embodiments, the group may be defined as a function of themetadata and/or the operations to be performed. For example, a firstoperation to certain metadata may require a second operation on suchmetadata (e.g. due to dependencies, etc.). In such case, thecorresponding instructions may be considered grouped.

Thereafter, the operation is conditionally performed on the instances ofmetadata associated with the environment of the subscriber, based onwhether at least one of the instructions is permissible. See operation404. Again, with respect to each of the terms set forth in operation404, corresponding definitions may be found, where applicable, duringthe description of FIG. 1 above.

Further, the instructions may be deemed permissible based on any desiredcriteria. For example, a plurality of rules may dictate suchpermissibility. In various embodiments, such rules may involve themodification of the metadata (e.g. size limits, etc.), the requestitself (e.g. formatting, protocol issues, etc.), and/or any otheraspect.

Thus, in one embodiment, the operation may not necessarily be performedon the instances of metadata, if at least one of the instructions isimpermissible. In other words, all of the instructions of the group maybe required to be permissible, in order for the operation(s) to beapplied. The ability of embodiments to provide such feature can thusprevent a scenario where only a portion of a desired effect isaccomplished which, in turn, complicates any effort to undo the partialmodification, etc.

More illustrative information will now be set forth regarding variousoptional architectures and features with which the foregoing frameworkmay or may not be implemented, per the desires of the user. It should bestrongly noted that the following information is set forth forillustrative purposes and should not be construed as limiting in anymanner. Any of the following features may be optionally incorporatedwith or without the exclusion of other features described.

FIGS. 5A-5B show a method 500 for applying a group of instructions tometadata in the context of an on-demand database service, in accordancewith another embodiment. As an option, the present method 500 may beimplemented in the context of the functionality of FIGS. 1-4. Of course,however, the method 500 may be carried out in any desired environment.The aforementioned definitions may apply during the present description.

As shown, multiple requests are received. See operation 502. It is thendetermined whether the requests are members of a group. See decision504.

To accomplish this, each request of a group may be flagged as such. Thismay be done by asserting a bit in association with the request, taggingthe request, sending the request via a protocol that indicates the groupstatus, if any, etc. In one embodiment, any such data structure orprotocol may include a group identifier that uniquely identifies anassociated group. In other embodiments, any of the foregoing may beaccomplished via a mechanism (e.g. data structure, etc.) that isseparate from the request itself, and possibly be stored at a centrallocation, etc.

In any case, if it is determined that the requests are not part of agroup, such requests may simply be processed. See operation 506. In oneembodiment, such processing may involve an operation on meta data inaccordance with an instruction accompanying the request. In anotherembodiment, such processing may include any of the techniques set forthearlier during reference to FIGS. 1-3. In such situations where therequests are not part of a group, each request that is permissible maybe processed irrespective of any other of the multiple requests beingdeemed impermissible.

If it is determined that the requests are indeed part of a group, afirst request is selected. See operation 505. Further, it is firstdetermined whether such request is permissible, as indicated in decision506. Again, such permissibility may be based on any desired criteria,such as that set forth above in describing FIGS. 2A/2B, 4, etc.

If the present request is deemed impermissible, an error message is sentto the subscriber. Further, the method 500 terminates and none of therequests of the group are processed.

If, however, the present request is deemed permissible, it is determinedwhether another request is included in the group. See decision 512. Ifso, a next request is selected in operation 516. Further, operations506-512 are repeated accordingly. Upon it being determined that no otherrequest is included in the group in decision 512 (and thus, each of therequests of the group are permissible), all of the requests of the groupare processed and a confirmation message is sent to the subscriber. Noteoperation 514.

System Overview

FIG. 6 illustrates a block diagram of an environment 610 wherein anon-demand database service might be used. As an option, any of thepreviously described embodiments of the foregoing figures may or may notbe implemented in the context of the environment 610. Environment 610may include user systems 612, network 614, system 616, processor system617, application platform 618, network interface 620, tenant datastorage 622, system data storage 624, program code 626, and processspace 628. In other embodiments, environment 610 may not have all of thecomponents listed and/or may have other elements instead of, or inaddition to, those listed above.

Environment 610 is an environment in which an on-demand database serviceexists. User system 612 may be any machine or system that is used by auser to access a database user system. For example, any of user systems612 can be a handheld computing device, a mobile phone, a laptopcomputer, a work station, and/or a network of computing devices. Asillustrated in FIG. 6 (and in more detail in FIG. 7) user systems 612might interact via a network with an on-demand database service, whichis system 616.

An on-demand database service, such as system 616, is a database systemthat is made available to outside users that do not need to necessarilybe concerned with building and/or maintaining the database system, butinstead may be available for their use when the users need the databasesystem (e.g., on the demand of the users). Some on-demand databaseservices may store information from one or more tenants stored intotables of a common database image to form a multi-tenant database system(MTS). Accordingly, “on-demand database service 616” and “system 616”will be used interchangeably herein. A database image may include one ormore database objects. A relational database management system (RDMS) orthe equivalent may execute storage and retrieval of information againstthe database object(s). Application platform 618 may be a framework thatallows the applications of system 616 to run, such as the hardwareand/or software, e.g., the operating system. In an embodiment, on-demanddatabase service 616 may include an application platform 618 thatenables creation, managing and executing one or more applicationsdeveloped by the provider of the on-demand database service, usersaccessing the on-demand database service via user systems 612, or thirdparty application developers accessing the on-demand database servicevia user systems 612.

The users of user systems 612 may differ in their respective capacities,and the capacity of a particular user system 612 might be entirelydetermined by permissions (permission levels) for the current user. Forexample, where a salesperson is using a particular user system 612 tointeract with system 616, that user system has the capacities allottedto that salesperson. However, while an administrator is using that usersystem to interact with system 616, that user system has the capacitiesallotted to that administrator. In systems with a hierarchical rolemodel, users at one permission level may have access to applications,data, and database information accessible by a lower permission leveluser, but may not have access to certain applications, databaseinformation, and data accessible by a user at a higher permission level.Thus, different users will have different capabilities with regard toaccessing and modifying application and database information, dependingon a user's security or permission level.

Network 614 is any network or combination of networks of devices thatcommunicate with one another. For example, network 614 can be any one orany combination of a LAN (local area network), WAN (wide area network),telephone network, wireless network, point-to-point network, starnetwork, token ring network, hub network, or other appropriateconfiguration. As the most common type of computer network in currentuse is a TCP/IP (Transfer Control Protocol and Internet Protocol)network, such as the global internetwork of networks often referred toas the “Internet” with a capital “I,” that network will be used in manyof the examples herein. However, it should be understood that thenetworks that the present invention might use are not so limited,although TCP/IP is a frequently implemented protocol.

User systems 612 might communicate with system 616 using TCP/IP and, ata higher network level, use other common Internet protocols tocommunicate, such as HTTP, FTP, AFS, WAP, etc. In an example where HTTPis used, user system 612 might include an HTTP client commonly referredto as a “browser” for sending and receiving HTTP messages to and from anHTTP server at system 616. Such an HTTP server might be implemented asthe sole network interface between system 616 and network 614, but othertechniques might be used as well or instead. In some implementations,the interface between system 616 and network 614 includes load sharingfunctionality, such as round-robin HTTP request distributors to balanceloads and distribute incoming HTTP requests evenly over a plurality ofservers. At least as for the users that are accessing that server, eachof the plurality of servers has access to the MTS' data; however, otheralternative configurations may be used instead.

In one embodiment, system 616, shown in FIG. 6, implements a web-basedcustomer relationship management (CRM) system. For example, in oneembodiment, system 616 includes application servers configured toimplement and execute CRM software applications as well as providerelated data, code, forms, webpages and other information to and fromuser systems 612 and to store to, and retrieve from, a database systemrelated data, objects, and Webpage content. With a multi-tenant system,data for multiple tenants may be stored in the same physical databaseobject, however, tenant data typically is arranged so that data of onetenant is kept logically separate from that of other tenants so that onetenant does not have access to another tenant's data, unless such datais expressly shared. In certain embodiments, system 616 implementsapplications other than, or in addition to, a CRM application. Forexample, system 616 may provide tenant access to multiple hosted(standard and custom) applications, including a CRM application. User(or third party developer) applications, which may or may not includeCRM, may be supported by the application platform 618, which managescreation, storage of the applications into one or more database objectsand executing of the applications in a virtual machine in the processspace of the system 616.

One arrangement for elements of system 616 is shown in FIG. 7, includinga network interface 620, application platform 618, tenant data storage622 for tenant data 623, system data storage 624 for system dataaccessible to system 616 and possibly multiple tenants, program code 626for implementing various functions of system 616, and a process space628 for executing MTS system processes and tenant-specific processes,such as running applications as part of an application hosting service.Additional processes that may execute on system 616 include databaseindexing processes.

Several elements in the system shown in FIG. 6 include conventional,well-known elements that are explained only briefly here. For example,each user system 612 could include a desktop personal computer,workstation, laptop, PDA, cell phone, or any wireless access protocol(WAP) enabled device or any other computing device capable ofinterfacing directly or indirectly to the Internet or other networkconnection. User system 612 typically runs an HTTP client, e.g., abrowsing program, such as Microsoft's Internet Explorer browser,Netscape's Navigator browser, Opera's browser, or a WAP-enabled browserin the case of a cell phone, PDA or other wireless device, or the like,allowing a user (e.g., subscriber of the multi-tenant database system)of user system 612 to access, process and view information, pages andapplications available to it from system 616 over network 614. Each usersystem 612 also typically includes one or more user interface devices,such as a keyboard, a mouse, trackball, touch pad, touch screen, pen orthe like, for interacting with a graphical user interface (GUI) providedby the browser on a display (e.g., a monitor screen, LCD display, etc.)in conjunction with pages, forms, applications and other informationprovided by system 616 or other systems or servers. For example, theuser interface device can be used to access data and applications hostedby system 616, and to perform searches on stored data, and otherwiseallow a user to interact with various GUI pages that may be presented toa user. As discussed above, embodiments are suitable for use with theInternet, which refers to a specific global internetwork of networks.However, it should be understood that other networks can be used insteadof the Internet, such as an intranet, an extranet, a virtual privatenetwork (VPN), a non-TCP/IP based network, any LAN or WAN or the like.

According to one embodiment, each user system 612 and all of itscomponents are operator configurable using applications, such as abrowser, including computer code run using a central processing unitsuch as an Intel Pentium® processor or the like. Similarly, system 616(and additional instances of an MTS, where more than one is present) andall of their components might be operator configurable usingapplication(s) including computer code to run using a central processingunit such as processor system 617, which may include an Intel Pentium®processor or the like, and/or multiple processor units. A computerprogram product embodiment includes a machine-readable storage medium(media) having instructions stored thereon/in which can be used toprogram a computer to perform any of the processes of the embodimentsdescribed herein. Computer code for operating and configuring system 616to intercommunicate and to process webpages, applications and other dataand media content as described herein are preferably downloaded andstored on a hard disk, but the entire program code, or portions thereof,may also be stored in any other volatile or non-volatile memory mediumor device as is well known, such as a ROM or RAM, or provided on anymedia capable of storing program code, such as any type of rotatingmedia including floppy disks, optical discs, digital versatile disk(DVD), compact disk (CD), microdrive, and magneto-optical disks, andmagnetic or optical cards, nanosystems (including molecular memory ICs),or any type of media or device suitable for storing instructions and/ordata. Additionally, the entire program code, or portions thereof, may betransmitted and downloaded from a software source over a transmissionmedium, e.g., over the Internet, or from another server, as is wellknown, or transmitted over any other conventional network connection asis well known (e.g., extranet, VPN, LAN, etc.) using any communicationmedium and protocols (e.g., TCP/IP, HTTP, HTTPS, Ethernet, etc.) as arewell known. It will also be appreciated that computer code forimplementing embodiments of the present invention can be implemented inany programming language that can be executed on a client system and/orserver or server system such as, for example, C, C++, HTML, any othermarkup language, Java™, JavaScript, ActiveX, any other scriptinglanguage, such as VBScript, and many other programming languages as arewell known may be used. (Java™ is a trademark of Sun Microsystems,Inc.).

According to one embodiment, each system 616 is configured to providewebpages, forms, applications, data and media content to user (client)systems 612 to support the access by user systems 612 as tenants ofsystem 616. As such, system 616 provides security mechanisms to keepeach tenant's data separate unless the data is shared. If more than oneMTS is used, they may be located in close proximity to one another(e.g., in a server farm located in a single building or campus), or theymay be distributed at locations remote from one another (e.g., one ormore servers located in city A and one or more servers located in cityB). As used herein, each MTS could include one or more logically and/orphysically connected servers distributed locally or across one or moregeographic locations. Additionally, the term “server” is meant toinclude a computer system, including processing hardware and processspace(s), and an associated storage system and database application(e.g., OODBMS or RDBMS) as is well known in the art. It should also beunderstood that “server system” and “server” are often usedinterchangeably herein. Similarly, the database object described hereincan be implemented as single databases, a distributed database, acollection of distributed databases, a database with redundant online oroffline backups or other redundancies, etc., and might include adistributed database or storage network and associated processingintelligence.

FIG. 7 also illustrates environment 610. However, in FIG. 7 elements ofsystem 616 and various interconnections in an embodiment are furtherillustrated. FIG. 7 shows that user system 612 may include processorsystem 612A, memory system 612B, input system 612C, and output system612D. FIG. 7 shows network 614 and system 616. FIG. 7 also shows thatsystem 616 may include tenant data storage 622, tenant data 623, systemdata storage 624, system data 625, User Interface (UI) 730, ApplicationProgram Interface (API) 732, PL/SOQL 734, save routines 736, applicationsetup mechanism 738, applications servers 1000 ₁-1000 _(N), systemprocess space 702, tenant process spaces 704, tenant management processspace 710, tenant storage area 712, user storage 714, and applicationmetadata 716. In other embodiments, environment 610 may not have thesame elements as those listed above and/or may have other elementsinstead of, or in addition to, those listed above.

User system 612, network 614, system 616, tenant data storage 622, andsystem data storage 624 were discussed above in FIG. 6. Regarding usersystem 612, processor system 612A may be any combination of one or moreprocessors. Memory system 612B may be any combination of one or morememory devices, short term, and/or long term memory. Input system 612Cmay be any combination of input devices, such as one or more keyboards,mice, trackballs, scanners, cameras, and/or interfaces to networks.Output system 612D may be any combination of output devices, such as oneor more monitors, printers, and/or interfaces to networks. As shown byFIG. 7, system 616 may include a network interface 620 (of FIG. 6)implemented as a set of HTTP application servers 700, an applicationplatform 618, tenant data storage 622, and system data storage 624. Alsoshown is system process space 702, including individual tenant processspaces 704 and a tenant management process space 710. Each applicationserver 1000 may be configured to tenant data storage 622 and the tenantdata 623 therein, and system data storage 624 and the system data 625therein to serve requests of user systems 612. The tenant data 623 mightbe divided into individual tenant storage areas 712, which can be eithera physical arrangement and/or a logical arrangement of data. Within eachtenant storage area 712, user storage 714 and application metadata 716might be similarly allocated for each user. For example, a copy of auser's most recently used (MRU) items might be stored to user storage714. Similarly, a copy of MRU items for an entire organization that is atenant might be stored to tenant storage area 712. A UI 730 provides auser interface and an API 732 provides an application programmerinterface to system 616 resident processes to users and/or developers atuser systems 612. The tenant data and the system data may be stored invarious databases, such as one or more Oracle™ databases.

Application platform 618 includes an application setup mechanism 738that supports application developers' creation and management ofapplications, which may be saved as metadata into tenant data storage622 by save routines 736 for execution by subscribers as one or moretenant process spaces 704 managed by tenant management process 710 forexample. Invocations to such applications may be coded using PL/SOQL 34that provides a programming language style interface extension to API732. A detailed description of some PL/SOQL language embodiments isdiscussed in commonly owned co-pending U.S. Provisional PatentApplication 60/828,192 entitled, PROGRAMMING LANGUAGE METHOD AND SYSTEMFOR EXTENDING APIS TO EXECUTE IN CONJUNCTION WITH DATABASE APIS, byCraig Weissman, filed Oct. 4, 2006, which is incorporated in itsentirety herein for all purposes. Invocations to applications may bedetected by one or more system processes, which manages retrievingapplication metadata 716 for the subscriber making the invocation andexecuting the metadata as an application in a virtual machine.

Each application server 700 may be communicably coupled to databasesystems, e.g., having access to system data 625 and tenant data 623, viaa different network connection. For example, one application server 700₁ might be coupled via the network 614 (e.g., the Internet), anotherapplication server 700 _(N-1) might be coupled via a direct networklink, and another application server 700 _(N) might be coupled by yet adifferent network connection. Transfer Control Protocol and InternetProtocol (TCP/IP) are typical protocols for communicating betweenapplication servers 700 and the database system. However, it will beapparent to one skilled in the art that other transport protocols may beused to optimize the system depending on the network interconnect used.

In certain embodiments, each application server 700 is configured tohandle requests for any user associated with any organization that is atenant. Because it is desirable to be able to add and remove applicationservers from the server pool at any time for any reason, there ispreferably no server affinity for a user and/or organization to aspecific application server 700. In one embodiment, therefore, aninterface system implementing a load balancing function (e.g., an F5Big-IP load balancer) is communicably coupled between the applicationservers 700 and the user systems 612 to distribute requests to theapplication servers 700. In one embodiment, the load balancer uses aleast connections algorithm to route user requests to the applicationservers 700. Other examples of load balancing algorithms, such as roundrobin and observed response time, also can be used. For example, incertain embodiments, three consecutive requests from the same user couldhit three different application servers 700, and three requests fromdifferent users could hit the same application server 700. In thismanner, system 616 is multi-tenant, wherein system 616 handles storageof, and access to, different objects, data and applications acrossdisparate users and organizations.

As an example of storage, one tenant might be a company that employs asales force where each salesperson uses system 616 to manage their salesprocess. Thus, a user might maintain contact data, leads data, customerfollow-up data, performance data, goals and progress data, etc., allapplicable to that user's personal sales process (e.g., in tenant datastorage 622). In an example of a MTS arrangement, since all of the dataand the applications to access, view, modify, report, transmit,calculate, etc., can be maintained and accessed by a user system havingnothing more than network access, the user can manage his or her salesefforts and cycles from any of many different user systems. For example,if a salesperson is visiting a customer and the customer has Internetaccess in their lobby, the salesperson can obtain critical updates as tothat customer while waiting for the customer to arrive in the lobby.

While each user's data might be separate from other users' dataregardless of the employers of each user, some data might beorganization-wide data shared or accessible by a plurality of users orall of the users for a given organization that is a tenant. Thus, theremight be some data structures managed by system 616 that are allocatedat the tenant level while other data structures might be managed at theuser level. Because an MTS might support multiple tenants includingpossible competitors, the MTS should have security protocols that keepdata, applications, and application use separate. Also, because manytenants may opt for access to an MTS rather than maintain their ownsystem, redundancy, up-time, and backup are additional functions thatmay be implemented in the MTS. In addition to user-specific data andtenant-specific data, system 616 might also maintain system level datausable by multiple tenants or other data. Such system level data mightinclude industry reports, news, postings, and the like that are sharableamong tenants.

In certain embodiments, user systems 612 (which may be client systems)communicate with application servers 700 to request and updatesystem-level and tenant-level data from system 616 that may requiresending one or more queries to tenant data storage 622 and/or systemdata storage 624. System 616 (e.g., an application server 700 in system616) automatically generates one or more SQL statements (e.g., one ormore SQL queries) that are designed to access the desired information.System data storage 624 may generate query plans to access the requesteddata from the database.

Each database can generally be viewed as a collection of objects, suchas a set of logical tables, containing data fitted into predefinedcategories. A “table” is one representation of a data object, and may beused herein to simplify the conceptual description of objects and customobjects according to the present invention. It should be understood that“table” and “object” may be used interchangeably herein. Each tablegenerally contains one or more data categories logically arranged ascolumns or fields in a viewable schema. Each row or record of a tablecontains an instance of data for each category defined by the fields.For example, a CRM database may include a table that describes acustomer with fields for basic contact information such as name,address, phone number, fax number, etc. Another table might describe apurchase order, including fields for information such as customer,product, sale price, date, etc. In some multi-tenant database systems,standard entity tables might be provided for use by all tenants. For CRMdatabase applications, such standard entities might include tables forAccount, Contact, Lead, and Opportunity data, each containingpre-defined fields. It should be understood that the word “entity” mayalso be used interchangeably herein with “object” and “table”.

In some multi-tenant database systems, tenants may be allowed to createand store custom objects, or they may be allowed to customize standardentities or objects, for example by creating custom fields for standardobjects, including custom index fields. U.S. patent application Ser. No.10/817,161, filed Apr. 2, 2004, entitled “Custom Entities and Fields ina Multi-Tenant Database System”, and which is hereby incorporated hereinby reference, teaches systems and methods for creating custom objects aswell as customizing standard objects in a multi-tenant database system.In certain embodiments, for example, all custom entity data rows arestored in a single multi-tenant physical table, which may containmultiple logical tables per organization. It is transparent to customersthat their multiple “tables” are in fact stored in one large table orthat their data may be stored in the same table as the data of othercustomers.

While the invention has been described by way of example and in terms ofthe specific embodiments, it is to be understood that the invention isnot limited to the disclosed embodiments. To the contrary, it isintended to cover various modifications and similar arrangements aswould be apparent to those skilled in the art. Therefore, the scope ofthe appended claims should be accorded the broadest interpretation so asto encompass all such modifications and similar arrangements.

1. A method, comprising: receiving at least one instruction indicatingat least one operation to be performed on metadata associated with anenvironment of a subscriber of an on-demand database service; andperforming the at least one operation on the metadata associated withthe environment of the subscriber asynchronously with respect to atleast one other operation performed by the subscriber using theon-demand database service.
 2. A method of claim 1, wherein the at leastone instruction is received utilizing an application program interface(API).
 3. A method of claim 1, wherein the at least one operationincludes at least one of creating, adding, deleting, updating, andstatus checking.
 4. A method of claim 1, wherein the metadata includesat least one of a configuration, an object, a field, and a valueassociated with the environment.
 5. A method of claim 1, and furthercomprising determining whether the at least one instruction ispermissible.
 6. A method of claim 5, wherein the at least one operationis conditionally performed based on the determination.
 7. A method ofclaim 5, wherein an error message is conditionally sent to thesubscriber based on the determination.
 8. A method of claim 5, whereinthe determination is based on a plurality of rules.
 9. A method of claim1, and further comprising updating values associated with the metadata.10. A method of claim 1, and further comprising sending a confirmationmessage to the subscriber, in response to the receipt of the at leastone instruction.
 11. A method of claim 1, and further comprisingreceiving a status request from the subscriber.
 12. A method of claim11, and further comprising sending a status message to the subscriber,in response to the receipt of the status request.
 13. A method of claim12, wherein the status message is conditionally sent to the subscriber,based on a time period within which the status request is received. 14.A method of claim 1, and further comprising processing the at least oneinstruction.
 15. A method of claim 14, wherein the processing includesdetermining whether the at least one instruction accompanies anasynchronous request.
 16. A method of claim 15, and further comprisingdetermining whether a processing capacity is available, if it isdetermined that the at least one instruction accompanies an asynchronousrequest.
 17. A method of claim 16, wherein the at least one instructionis processed in real-time, if it is determined that the processingcapacity is available.
 18. A method of claim 16, and further comprisingqueuing the at least one instruction for processing, if it is determinedthat the processing capacity is unavailable.
 19. A method of claim 1,wherein the at least one operation is capable of being performed on themetadata substantially independent of the at least one other operation.20. A method of claim 1, wherein the on-demand database service includesa multi-tenant database system.
 21. A machine-readable medium carryingone or more sequences of instructions which, when executed by one ormore processors, cause the one or more processors to carry out the stepsof: receiving at least one instruction indicating at least one operationto be performed on metadata associated with an environment of asubscriber of an on-demand database service; and performing the at leastone operation on the metadata associated with the environment of thesubscriber asynchronously with respect to at least one other operationperformed by the subscriber using the on-demand database service.
 22. Anapparatus, comprising: a processor; and one or more stored sequences ofinstructions which, when executed by the processor, cause the processorto carry out the steps of: receiving at least one instruction indicatingat least one operation to be performed on metadata associated with anenvironment of a subscriber of an on-demand database service; andperforming the at least one operation on the metadata associated withthe environment of the subscriber asynchronously with respect to atleast one other operation performed by the subscriber using theon-demand database service.
 23. A method for transmitting code in amulti-tenant database system on a transmission medium, the methodcomprising: transmitting code to process at least one instructionindicating at least one operation to be performed on metadata associatedwith an environment of a subscriber of an on-demand database service;and transmitting code to perform the at least one operation on themetadata associated with the environment of the subscriberasynchronously with respect to at least one other operation performed bythe subscriber using the on-demand database service.